<div class="admin-content">

    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">订单</strong> /
            <small>订单查找</small>
        </div>
        <!--<div class="am-fl am-cf" style="margin-left: 30px" ng-show="ngb">
            <span>切换会员</span>
            <select ng-model="ordertype" ng-change="changeOrder()">
                <option value="0">全部</option>
                <option value="1">会员</option>
            </select>
        </div>-->
        <div class="am-fl am-cf" style="margin-left: 100px">
            <small>订单开始时间</small>
            ：<input placeholder="订单开始时间" value="{{start_time_show}}" type="text" id="datetimepicker">
        </div>
        <div class="am-fl am-cf">
            <small>订单结束时间</small>
            ：<input placeholder="订单结束时间" value="{{end_time_show}}" type="text" id="datetimepicker1">
        </div>
        <div class="am-fl am-cf">
            <button type="button" ng-click="orderbytime()">确定</button>
        </div>
        <div style="float: right;">
            <!--<div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    <button type="button" class="am-btn am-btn-primary" ng-click="export_orders(orders)">导出订单</button>
                </div>
            </div>-->


        </div>
    </div>
    <div class="am-alert am-alert-danger" data-am-alert ng-show="alert_msg">
        <button type="button" class="am-close" ng-click="close_alert()">&times;</button>
        <p>{{alert_msg}}</p>
    </div>
    <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
            <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    <button type="button" class="am-btn am-btn-default" ng-click="orderbytime()"><span
                            class="am-icon-plus"></span> 查询全部
                    </button>
                    <button type="button" class="am-btn am-btn-default" ng-click="orderbystatus(2)"><span
                            class="am-icon-save"></span>已完成订单
                    </button>
                    <button type="button" class="am-btn am-btn-default" ng-click="orderbypaystate(0)"><span
                            class="am-icon-archive"></span>未付款订单
                    </button>
                    <button type="button" class="am-btn am-btn-default" ng-click="orderbypaystate(2)"><span
                            class="am-icon-trash-o"></span>已退款订单
                    </button>
                </div>
            </div>
        </div>

        <div class="am-u-sm-12 am-u-md-4" style="float: right;">
            <div class="am-input-group am-input-group-sm">
                <input type="text" class="am-form-field" ng-model="id" placeholder="请输入要查询的订单（订单号，电话，购买者）">
                <span class="am-input-group-btn">
            <button class="am-btn am-btn-default" type="button" ng-click="selectbyid(id)">搜索</button>
          </span>
            </div>
        </div>
        <div class="am-g">
            <div class="am-u-sm-12">
                <form class="am-form">
                    <table class="am-table am-table-striped am-table-hover table-main">
                        <thead>
                        <tr>
                            <th class="table-check"><input type="checkbox"/></th>
                            <th class="table-id">ID</th>
                            <th class="table-title">购买者</th>
                            <!-- <th class="table-type">订单留言</th> -->
                            <th class="table-date am-hide-sm-only">订单总额</th>
                            <th class="table-date am-hide-sm-only">实际总额</th>
                            <th class="table-date am-hide-sm-only">下单时间</th>
                            <th class="table-set">支付状态</th>
                            <th class="table-set">支付方式</th>
                            <th class="table-set">订单类型</th>
                            <th class="table-set">收货人</th>
                            <th class="table-set">收获地址</th>
                            <th class="table-set">收货电话</th>
                            <th class="table-set">编辑</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr dir-paginate="order in orders | filter:q | itemsPerPage: 8">
                            <td><input type="checkbox"/></td>
                            <td><a ui-sref="mealplan.orderdetail({orderid:order.orderid,order:order})">{{order.orderid}}</a>
                            </td>
                            <td>{{order.name}}</td>
                            <!-- <td>{{order.buyMessage}}</td> -->
                            <td class="am-hide-sm-only">{{order.totalFee|currency:'￥'}}</td>
                            <td class="am-hide-sm-only">{{order.payment|currency:'￥'}}</td>
                            <td class="am-hide-sm-only">{{order.createTime|date:'yyyy-MM-dd'}}</td>
                            <td>{{order.paystate| pay_type}}</td>
                            <td>{{order.paytype | order_paytype:order.paytype:order.type}}</td>
                            <td>{{order.type | order_type}}</td>
                            <td>{{order.receiverName}}</td>
                            <td>{{order.receiverAddress}}</td>
                            <td>{{order.receiverPhone}}</td>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <button class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                ui-sref="mealplan.orderdetail({orderid:order.orderid,order:order})"><span
                                                class="am-icon-pencil-square-o"></span>查看详情
                                        </button>
                                        <!--<button class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span> 复制</button>-->
                                        <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"
                                                confirmed-click="remove(order)"
                                                ng-confirm-click="确定删除这个商品'{{order.orderid}}'"><span
                                                class="am-icon-trash-o"></span>删除
                                        </button>
                                    </div>
                                </div>
                            </td>
                        </tr>

                        </tbody>

                    </table>

                    <div class="am-cf">
                        <div class="text-center">
                            <dir-pagination-controls boundary-links="true"
                                                     on-page-change="pageChangeHandler(newPageNumber)"
                                                     template-url="tpls/pagination/dirPagination.tpl.html"></dir-pagination-controls>
                        </div>
                    </div>


                </form>

            </div>

        </div>
    </div>

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="gridSystemModalLabel" style="color: #0099ff">您有{{newlength}}条新的订单</h4>
                </div>
                <div class="modal-body">
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                    <tr>
                                        <th class="table-check"><input type="checkbox"/></th>
                                        <th class="table-id">ID</th>
                                        <th class="table-title">购买者</th>
                                        <!-- <th class="table-type">订单留言</th> -->
                                        <th class="table-date am-hide-sm-only">订单总额</th>
                                        <!--  <th class="table-date am-hide-sm-only">实际总额</th> -->
                                        <th class="table-date am-hide-sm-only">下单时间</th>
                                        <th class="table-set">支付状态</th>
                                        <th class="table-set">支付方式</th>
                                        <th class="table-set">订单类型</th>
                                        <!-- <th class="table-set">收货人</th>
                                        <th class="table-set">收获地址</th>
                                        <th class="table-set">收货电话</th>
                                        <th class="table-set">编辑</th> -->
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr dir-paginate="order in neworders | filter:q | itemsPerPage: 4">
                                        <td><input type="checkbox"/></td>
                                        <td><a ui-sref="mall.orderdetail({orderid:order.orderid,order:order})">{{order.orderid}}</a>
                                        </td>
                                        <td>{{order.name}}</td>
                                        <!-- <td>{{order.buyMessage}}</td> -->
                                        <td class="am-hide-sm-only">{{order.totalFee|currency:'￥'}}</td>
                                        <!-- <td class="am-hide-sm-only">{{order.payment|currency:'￥'}}</td> -->
                                        <td class="am-hide-sm-only">{{order.createTime|date:'yyyy-MM-dd'}}</td>
                                        <td>{{order.paystate| pay_type}}</td>
                                        <td>{{order.paytype | order_paytype:order.paytype:order.type}}</td>
                                        <td>{{order.type | order_type}}</td>
                                        <!-- <td>{{order.receiverName}}</td>
                                        <td>{{order.receiverAddress}}</td>
                                        <td>{{order.receiverPhone}}</td>
                                        <td>
                                            <div class="am-btn-toolbar">
                                                <div class="am-btn-group am-btn-group-xs">
                                                    <button class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                            ui-sref="mall.orderdetail({orderid:order.orderid,order:order})"><span
                                                            class="am-icon-pencil-square-o"></span> 查看详情</button>
                                                </div>
                                            </div>
                                        </td> -->
                                    </tr>

                                    </tbody>

                                </table>

                                <div class="am-cf">
                                    <div class="text-center">
                                        <dir-pagination-controls boundary-links="true"
                                                                 on-page-change="pageChangeHandler(oldPageNumber)"
                                                                 template-url="tpls/pagination/dirPagination.tpl.html"></dir-pagination-controls>
                                    </div>
                                </div>


                            </form>

                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <!--<button type="button" class="btn btn-primary">Save changes</button>-->
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>